home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Magazine Collection 2001
/
Delphi Magazine Collection 20001 (2001).iso
/
DISKS
/
ISSUE23
/
STARTUP
/
StubDll32U.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-04-06
|
926b
|
50 lines
unit StubDll32U;
{$ifdef Ver90} //Delphi 2.0x
{$define Delphi2}
{$endif}
{$ifdef Ver93} //C++ Builder 1.0x
{$define Delphi2}
{$endif}
interface
implementation
uses
SysUtils;
var
OldExitProc: Pointer;
procedure NewExitProc;
begin
ExitProc := OldExitProc;
WriteLn('DLL: Exit procedure added the old fashioned way (ExitProc)');
end;
procedure NewerExitProc;
begin
WriteLn('DLL: Exit procedure added with AddExitProc');
end;
{$ifndef Delphi2}
function NewTerminateProc: Boolean;
begin
Result := True;
WriteLn('APP: Terminate function added with AddTerminateProc');
end;
{$endif}
initialization
WriteLn('DLL: Unit initialisation section');
OldExitProc := ExitProc;
ExitProc := @NewExitProc;
AddExitProc(@NewerExitProc);
{$ifndef Delphi2}
AddTerminateProc(NewTerminateProc)
{$endif}
finalization
WriteLn('DLL: Unit finalisation section');
end.